package algorithm.sort;

import algorithm.heap.MaxHeap;

public class MaxHeapSort implements Sort {
    @Override
    public String name() {
        return "最大堆排序";
    }

    @Override
    public void sort(Integer[] arr) {
        MaxHeap maxHeap = new MaxHeap(arr,arr.length);
        for (int i = arr.length-1; i >=0; i--) {
            arr[i] = maxHeap.pop();
        }
    }
}
